home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / education / pe002.dms / pe002.adf / Drawmap / drawmap-req.h < prev    next >
C/C++ Source or Header  |  1989-09-24  |  5KB  |  185 lines

  1. /* file drawmap-req.h */
  2.  
  3. #define NUM_CHAR 25                    /* # characters in text buffer */
  4.  
  5. #define TLEFT   24                     /* left edge of requester */
  6. #define TTOP    24                     /* top edge of requester  */
  7. #define TWIDTH  8*(NUM_CHAR+5)         /* width of requester     */
  8. #define THEIGHT 80                     /* height of requester    */
  9.  
  10. #define GAD_FIRST 1                    /* initial gadget id       */
  11. #define GAD_LEFT  16                   /* string gadget left edge */
  12. #define GAD_TOP   THEIGHT/2            /* string gadget top edge  */
  13.  
  14. struct IntuiText rtext = {             /* text in requester */
  15.    BLACK, ORANGE, JAM1,
  16.    GAD_LEFT, (GAD_TOP-4)/2,
  17.    NULL,
  18.    (UBYTE *) "Enter desired text:",
  19.    NULL
  20. };
  21.  
  22. UBYTE userinput[NUM_CHAR+1];           /* buffer for user text */
  23. UBYTE defaulttext[] = "Text";          /* default text         */
  24.  
  25. struct StringInfo gadgetinput = {      /* gadget string text           */
  26.    &userinput[0],                      /* buffer for user input        */
  27.    NULL,                               /* no undo buffer               */
  28.    0,                                  /* character position in buffer */
  29.    NUM_CHAR+1,                         /* max. characters in buffer    */
  30.    0,                                  /* buffer position of first     */
  31.                                        /*   displayed character        */
  32.    0, 0, 0, 0, 0, NULL, 0, NULL        /* Intuition local variables    */
  33. };
  34.  
  35. struct Gadget gad = {                  /* string gadget structure  */
  36.    NULL,                               /* pointer to next gadget   */
  37.    GAD_LEFT, GAD_TOP, 8*(NUM_CHAR+1),  /* left, top, width, height */
  38.          10,                           /*   of hit box             */
  39.    GADGHCOMP,                          /* flags                    */
  40.    RELVERIFY | ENDGADGET,              /* activation flags         */
  41.    REQGADGET | STRGADGET,              /* gadget type = string     */
  42.    NULL,                               /* border descriptor        */
  43.    NULL,                               /* alternate imagery        */
  44.    NULL,                               /* gadget text              */
  45.    0,                                  /* no mutual exclusion      */
  46.    (APTR) &gadgetinput,                /* special info             */
  47.    GAD_FIRST,                          /* gadget identifier        */
  48.    NULL                                /* pointer to data          */
  49. };
  50.  
  51. short bordertop2[] = {                 /* inside top border */
  52.    8, 8,
  53.    TWIDTH-9, 8
  54. };
  55.  
  56. short borderright2[] = {               /* inside right border */
  57.    TWIDTH-9, 8,
  58.    TWIDTH-9, THEIGHT-9
  59. };
  60.  
  61. short borderbottom2[] = {              /* inside bottom border */
  62.    TWIDTH-9, THEIGHT-9,
  63.    8, THEIGHT-9
  64. };
  65.  
  66. short borderleft2[] = {                /* inside left border */
  67.    8, THEIGHT-9,
  68.    8, 8
  69. };
  70.  
  71. short bordertop[] = {                  /* top border lines */
  72.    0, 0,
  73.    TWIDTH-1, 0,
  74.    TWIDTH-2, 1,
  75.    1, 1,
  76.    2, 2,
  77.    TWIDTH-3, 2,
  78.    TWIDTH-4, 3,
  79.    3, 3
  80. };
  81.  
  82. #define NUM_PAIRS_TOP sizeof(bordertop) / (2*sizeof(short))
  83.  
  84. short borderright[] = {                /* right border lines */
  85.    TWIDTH-4, 3,
  86.    TWIDTH-4, THEIGHT-4,
  87.    TWIDTH-3, 2,
  88.    TWIDTH-3, THEIGHT-3,
  89.    TWIDTH-2, THEIGHT-2,
  90.    TWIDTH-2, 1,
  91.    TWIDTH-1, 0,
  92.    TWIDTH-1, THEIGHT-1
  93. };
  94.  
  95. #define NUM_PAIRS_RIGHT sizeof(borderright) / (2*sizeof(short))
  96.  
  97. short borderbottom[] = {               /* bottom border lines */
  98.    TWIDTH-1, THEIGHT-1,
  99.    0, THEIGHT-1,
  100.    1, THEIGHT-2,
  101.    TWIDTH-2, THEIGHT-2,
  102.    TWIDTH-3, THEIGHT-3,
  103.    2, THEIGHT-3,
  104.    3, THEIGHT-4,
  105.    TWIDTH-4, THEIGHT-4
  106. };
  107.  
  108. #define NUM_PAIRS_BOTTOM sizeof(borderbottom) / (2*sizeof(short))
  109.  
  110. short borderleft[] = {                 /* left border lines */
  111.    3, THEIGHT-4,
  112.    3, 3,
  113.    2, THEIGHT-3,
  114.    2, 2,
  115.    1, 1,
  116.    1, THEIGHT-2,
  117.    0, THEIGHT-1,
  118.    0, 0
  119. };
  120.  
  121. #define NUM_PAIRS_LEFT sizeof(borderleft) / (2*sizeof(short))
  122.  
  123. struct Border border_left2 = {         /* inside left border */
  124.    0, 0,
  125.    BLACK, ORANGE, JAM1,
  126.    2,
  127.    (short *) &borderleft2[0],
  128.    NULL
  129. };
  130.  
  131. struct Border border_bottom2 = {       /* inside bottom border */
  132.    0, 0,
  133.    WHITE, ORANGE, JAM1,
  134.    2,
  135.    (short *) &borderbottom2[0],
  136.    &border_left2
  137. };
  138.  
  139. struct Border border_right2 = {        /* inside right border */
  140.    0, 0,
  141.    WHITE, ORANGE, JAM1,
  142.    2,
  143.    (short *) &borderright2[0],
  144.    &border_bottom2
  145. };
  146.  
  147. struct Border border_top2 = {          /* inside top border */
  148.    0, 0,   BLACK, ORANGE, JAM1,
  149.    2,
  150.    (short *) &bordertop2[0],
  151.    &border_right2
  152. };
  153.  
  154. struct Border border_left = {          /* left border */
  155.    0, 0,
  156.    WHITE, ORANGE, JAM1,
  157.    NUM_PAIRS_LEFT,
  158.    (short *) &borderleft[0],
  159.    &border_top2
  160. };
  161.  
  162. struct Border border_bottom = {        /* bottom border */
  163.    0, 0,
  164.    BLACK, ORANGE, JAM1,
  165.    NUM_PAIRS_BOTTOM,
  166.    (short *) &borderbottom[0],
  167.    &border_left
  168. };
  169.  
  170. struct Border border_right = {         /* right border */
  171.    0, 0,
  172.    BLACK, ORANGE, JAM1,
  173.    NUM_PAIRS_RIGHT,
  174.    (short *) &borderright[0],
  175.    &border_bottom
  176. };
  177.  
  178. struct Border border_top = {     /* top border */
  179.    0, 0,
  180.    WHITE, ORANGE, JAM1,
  181.    NUM_PAIRS_TOP,
  182.    (short *) &bordertop[0],
  183.    &border_right
  184. };
  185.